<template>
  <div>
    <el-form ref="formRef" :model="form" :rules="rules" size="medium" label-width="100px">
      <el-row :gutter="15">
        <el-col :span="6">
          <el-form-item label="学科" prop="subjectID">
            <el-select v-model="form.subjectID" placeholder="请选择" clearable :style="{width: '100%'}">
              <el-option v-for="(item, index) in subjectIDOptions" :key="index" :label="item.label"
                :value="item.value" :disabled="item.disabled"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="二级目录" prop="catalogID">
            <el-select v-model="form.catalogID" placeholder="请选择" clearable :style="{width: '100%'}">
              <el-option v-for="(item, index) in catalogIDOptions" :key="index" :label="item.label"
                :value="item.value" :disabled="item.disabled"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="标签" prop="field105">
            <el-select v-model="form.field105" placeholder="请选择" clearable :style="{width: '100%'}">
              <el-option v-for="(item, index) in field105Options" :key="index" :label="item.label"
                :value="item.value" :disabled="item.disabled"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="根据题干搜索" prop="keyword">
            <el-input v-model="form.keyword" placeholder="" clearable :style="{width: '100%'}">
            </el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="15">
        <el-col :span="6">
          <el-form-item label="试题类型" prop="questionType">
            <el-select v-model="form.questionType" placeholder="请选择" clearable :style="{width: '100%'}">
              <el-option v-for="(item, index) in questionTypeOptions" :key="index" :label="item.label"
                :value="item.value" :disabled="item.disabled"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="难度" prop="difficulty">
            <el-select v-model="form.difficulty" placeholder="请选则" clearable :style="{width: '100%'}">
              <el-option v-for="(item, index) in difficultyOptions" :key="index" :label="item.label"
                :value="item.value" :disabled="item.disabled"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="方向" prop="direction">
            <el-select v-model="form.direction" placeholder="请选择" clearable :style="{width: '100%'}">
              <el-option v-for="(item, index) in directionOptions" :key="index" :label="item.label"
                :value="item.value" :disabled="item.disabled"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="录入人" prop="creatorID">
            <el-select v-model="form.creatorID" placeholder="请选择" clearable :style="{width: '100%'}">
              <el-option v-for="(item, index) in creatorIDOptions" :key="index" :label="item.label"
                :value="item.value" :disabled="item.disabled"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="15">
        <el-col :span="6">
          <el-form-item label="题目备注" prop="remarks">
            <el-input v-model="form.remarks" placeholder="" clearable :style="{width: '100%'}">
            </el-input>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="企业简称" prop="shortName">
            <el-input v-model="form.shortName" placeholder="" clearable :style="{width: '100%'}">
            </el-input>
          </el-form-item>
        </el-col>
      
        <el-col :span="6">
          <el-form-item size="large">
             <el-button type="primary" @click="submitForm">提交</el-button>
            <el-button @click="resetForm">重置</el-button>
      </el-form-item>
        </el-col>
      </el-row>

    </el-form>
  </div>
</template>
<script>
import { provinces, citys } from '@/api/hmmm/citys.js'
export default {
  components: {},
  props: [],
  data() {
    return {
      citySelect: {
        province: [],
        cityDate: []
      },

      form: {
        subjectID: undefined,
        catalogID: undefined,
        field105: undefined,
        keyword: undefined,
        questionType: undefined,
        difficulty: undefined,
        direction: undefined,
        creatorID: undefined,
        remarks: undefined,
        shortName: undefined,
      },
      rules: {
        subjectID: [{
          
          message: '请选择学科',
          trigger: 'change'
        }],
        catalogID: [{
          
          message: '请选择二级目录',
          trigger: 'change'
        }],
        field105: [{
          
          message: '请选择标签',
          trigger: 'change'
        }],
        keyword: [{
          
          message: '请输入关键字',
          trigger: 'blur'
        }],
        questionType: [{
          
          message: '请选择试题类型',
          trigger: 'change'
        }],
        difficulty: [{
          
          message: '请选择难度',
          trigger: 'change'
        }],
        direction: [{
          
          message: '请选择方向',
          trigger: 'change'
        }],
        creatorID: [{
          
          message: '请选择录入人',
          trigger: 'change'
        }],
        remarks: [{
          
          message: '请输入题目备注',
          trigger: 'blur'
        }],
        shortName: [{
          
          message: '请输入企业简称',
          trigger: 'blur'
        }],
      },
      subjectIDOptions: [{
        "label": "选项一",
        "value": 1
      }, {
        "label": "选项二",
        "value": 2
      }],
      catalogIDOptions: [{
        "label": "选项一",
        "value": 1
      }, {
        "label": "选项二",
        "value": 2
      }],
      field105Options: [{
        "label": "选项一",
        "value": 1
      }, {
        "label": "选项二",
        "value": 2
      }],
      questionTypeOptions: [{
        "label": "选项一",
        "value": 1
      }, {
        "label": "选项二",
        "value": 2
      }],
      difficultyOptions: [{
        "label": "选项一",
        "value": 1
      }, {
        "label": "选项二",
        "value": 2
      }],
      directionOptions: [{
        "label": "选项一",
        "value": 1
      }, {
        "label": "选项二",
        "value": 2
      }],
      creatorIDOptions: [{
        "label": "选项一",
        "value": 1
      }, {
        "label": "选项二",
        "value": 2
      }],
    }
  },
  computed: {},
  watch: {},
  // created() {
  //   getCityData(),
  //   handleProvince()
  // },
  mounted() {},
  methods: {
    submitForm() {
      this.$refs['formRef'].validate(valid => {
        if (!valid) return
        // TODO 提交表单
      })
    },
    resetForm() {
      this.$refs['formRef'].resetFields()
    },
    // // 获取省
    // getCityData: function () {
    //   this.citySelect.province = provinces()
    // },
    // // 选省获取到市
    // handleProvince: function (e) {
    //   this.citySelect.cityDate = citys(e)
    //   this.requestParameters.city = this.citySelect.cityDate[0]
    // }
  }
}

</script>
<style>
</style>
